package ass.web;

import java.io.IOException;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import ass.beans.CinemaBean;
import ass.beans.MovieBean;
import ass.beans.UserBean;
import ass.dao.MovieDAO;
import ass.dao.support.CinemaDAOImpl;
import ass.dao.support.MovieDAOImpl;
import ass.dao.support.UserDAOImpl;

/**
 * Servlet implementation class ticketBookingServlet
 */
public class ticketBookingServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public ticketBookingServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

//		String title = (String) request.getParameter("title");
//		MovieDAO movieDAO = new MovieDAOImpl();
//		MovieBean movieResult = movieDAO.getMovieByTitle(title);
//
//		CinemaDAOImpl cinemaDAO = new CinemaDAOImpl();	
//		List<CinemaBean> cinemabeanlist = cinemaDAO.getCinema();
		
		String nextJSP = "/userTicketBooking.jsp";
		RequestDispatcher dispatcher = getServletContext()
				.getRequestDispatcher(nextJSP);
//		request.setAttribute("MovieBean", movieResult);
//		request.setAttribute("cinemabeanlist", cinemabeanlist);		
		dispatcher.forward(request, response);
		
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//		String cinema = (String) request.getParameter("cinema");
//		String movie = (String)request.getParameter("movie");
//		String amount = (String) request.getParameter("amount");
//
//		UserDAOImpl userDAOImpl = new UserDAOImpl();
//		UserBean userbean = userDAOImpl.getUser("session name");
//		UserBean newuserbean = userbean.update();
		

		
	}

}
